<script setup>
import {ref,computed} from "vue"

let width = ref(0)
let height = ref(0)

let area = computed(() =>{
    return width.value*height.value
})

 // v-model 输入的字 自动与变量绑定
 
</script>

<template>
    <div>
        <label for="length">长：</label>
        <input type="number" name="height" v-model="height"></input> 
        <label for="width">宽：</label>
        <input type="number" name="width" v-model="width"></input>
        <label for="area">面积：</label>
        <input type="number" name="area" :value="area" readonly></input>
    </div>

</template>

<style scoped>
    
</style>